import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const express = require('express');
const test = express.Router();
test.get('/testGet',(req,res)=>{
//     测试 get请求
    returnParams(req.query,res)
})
test.post('/testPost', (req, res) => { // 测试post 请求
    returnParams(req.body, res)
})
function returnParams(data, res) {
    res.json({ code: 1, status: 'S', data: data, msg: '成功' })
}

module.exports = test
// export {test}